import java.util.Scanner;

public class text4 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] score = new int[6];
        for (int i = 0; i < score.length; ) {
            System.out.println("请输入第" + (i + 1) + "位评委所打分数");
            score[i] = sc.nextInt();
            if (score[i] >= 0 && score[i] <= 100) {
                i++;
            } else {
                System.out.println("数据错误,请重新输入");
            }
        }
        int sum = 0;
        int max = score[0];
        int min = score[0];
        for (int i = 0; i < score.length; i++) {
            if (score[i] > max) {
                max = score[i];
            }
        }
        for (int i = 0; i < score.length; i++) {
            if (score[i] < min) {
                min = score[i];
            }
        }
        for (int i = 0; i < score.length; i++) {
            sum += score[i];
        }
        int average = (sum - max - min) / (score.length - 2);
        System.out.println(average);
    }
}
